package sqcon.sql;

public class LogicalNode extends ConditionTreeNode{
	
	private LogicOperator operator;
	private ConditionTreeNode leftChild;
	private ConditionTreeNode rightChild;
	
	public LogicalNode(LogicOperator operator, ConditionTreeNode leftChild, 
			ConditionTreeNode rightChild){
		this.operator = operator;
		this.leftChild = leftChild;
		this.rightChild = rightChild;
	}
	
	@Override
	public boolean isLeaf(){
		return false;
	}
	
	@Override
	public String printString(){
		return "("+ leftChild.printString() + " " 
			+ operator.printString() + " "
			+ rightChild.printString() + ")";
	}
	
	public LogicOperator getOperator(){
		return operator;
	}
	
	public ConditionTreeNode getLeftChild(){
		return leftChild;
	}
	
	public ConditionTreeNode getRightChild(){
		return rightChild;
	}
}
